home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / usplash.postinst < prev    next >
Encoding:
Text File  |  2007-04-02  |  1.9 KB  |  86 lines

  1. #!/bin/bash -e
  2. # This script can be called in the following ways:
  3. #
  4. # After the package was installed:
  5. #       <postinst> configure <old-version>
  6. #
  7. #
  8. # If prerm fails during upgrade or fails on failed upgrade:
  9. #       <old-postinst> abort-upgrade <new-version>
  10. #
  11. # If prerm fails during deconfiguration of a package:
  12. #       <postinst> abort-deconfigure in-favour <new-package> <version>
  13. #                  removing <old-package> <version>
  14. #
  15. # If prerm fails during replacement due to conflict:
  16. #       <postinst> abort-remove in-favour <new-package> <version>
  17.  
  18. . /usr/share/debconf/confmodule
  19.  
  20. # Remove the alternative for the default artwork we used to ship
  21. rm_default_artwork()
  22. {
  23.     update-alternatives --remove usplash-artwork.so \
  24.     /usr/lib/usplash/usplash-default.so
  25. }
  26.  
  27. # Update the initramfs
  28. update_initramfs()
  29. {
  30.     update-initramfs -u
  31. }
  32.  
  33. # Write a config file
  34. setup_usplash_config()
  35. {
  36.     if [ ! -f /etc/usplash.conf ]; then
  37.     db_version 2.0
  38.     if  db_get xserver-xorg/config/display/modes; then
  39.       FIRSTVAL=`echo $RET | sed 's/,.*//'`
  40.       x=`echo $FIRSTVAL | sed 's/x.*//'`
  41.       y=`echo $FIRSTVAL | sed 's/.*x//'`
  42.     else
  43.       x=640;
  44.       y=480;
  45.         fi
  46.     echo "# Usplash configuration file" >/etc/usplash.conf
  47.     echo "xres=$x" >>/etc/usplash.conf
  48.     echo "yres=$y" >>/etc/usplash.conf
  49.     fi
  50. }
  51.  
  52. case "$1" in
  53.     configure)
  54.     if dpkg --compare-versions "$2" lt "0.3-1"; then
  55.         rm_default_artwork
  56.     fi
  57.  
  58.     if dpkg --compare-versions "$2" lt "0.4-31" && \
  59.         [ ! -e /usr/lib/usplash/usplash-artwork.so ]; then
  60.         update-alternatives --auto usplash-artwork.so
  61.     fi
  62.         
  63.  
  64.     setup_usplash_config
  65.  
  66.     update_initramfs
  67.     ;;
  68.  
  69.     abort-upgrade|abort-deconfigure|abort-remove)
  70.     ;;
  71.  
  72.     *)
  73.     echo "$0 called with unknown argument \`$1'" 1>&2
  74.     exit 1
  75.     ;;
  76. esac
  77.  
  78. # Automatically added by dh_installinit
  79. if [ -x "/etc/init.d/usplash" ]; then
  80.     update-rc.d usplash start 98 2 3 4 5 . stop 01 0 1 6 . >/dev/null || exit $?
  81. fi
  82. # End automatically added section
  83.  
  84.  
  85. exit 0
  86.